﻿using System;
using System.Web.UI;

namespace AMS.Web.WorkBill
{
    public partial class WoCodeCreatorCtl : UserControl
    {
        private void SetDefaultVal()
        {
            if (txtVal.Text.Length == 0)
            {
                txtVal.Text = WoCodeCreateHelper.GetNewWoCode();
            }
        }
        public string Text
        {
            get
            {
                SetDefaultVal();
                return txtVal.Text;
            }
            set
            {
                txtVal.Text = value;
                SetDefaultVal();
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                SetDefaultVal();
        }
    }
}